import { axios } from '@/utils/request'

const api = {
  basicsUpdateInfo: '/admin/org-basics-info/updateInfo',
  basicsInfo: '/admin/org-basics-info/getInfoDetails',
  brokerageConfigInfo: '/admin/brokerageConfig/getTenantInfo',
  orgPermissionInfo: '/admin/orgPermission/getTenantInfo',
  tenantSave: '/admin/cooperationResourceConfig/tenantSave',
  payInfo: '/admin/org-paymenconfig/getPayInfo',
  updatePayInfo: '/admin/org-paymenconfig/updateInfo',

  /** 会内配置相关 */
  innerTenantInfo: '/admin/insideResourceConfig/getTenantInfo',
  innerTenantSave: '/admin/insideResourceConfig/tenantSave',
  /** 会内-根据项目类型查询资源配置 */
  getTenantInfoByProjectType: '/admin/insideResourceConfig/getTenantInfoByProjectType',
  /** 会外-根据项目类型查询资源配置 */
  orgGetTenantInfoByProjectType: 'admin/orgPermission/getTenantInfoByProjectType',
  /** 会内-根据项目类型修改设置 */
  tenantOneSave: '/admin/insideResourceConfig/tenantOneSave',
  /** 会外-根据项目类型修改设置 */
  orgTenantOneSave: 'admin/cooperationResourceConfig/tenantOneSave'
}

/**
 * 修改机构信息
 */
export function basicsUpdateInfo(data) {
  return axios({
    url: api.basicsUpdateInfo,
    method: 'post',
    data
  })
}

/**
 * 获取机构信息
 */
export function basicsInfo() {
  return axios({
    url: api.basicsInfo,
    method: 'get'
  })
}

/**
 * 查询分润设置
 */
export function BrokerageConfigInfo() {
  return axios({
    url: api.brokerageConfigInfo,
    method: 'get'
  })
}

/**
 * 获取支付配置
 */
export function PayInfo() {
  return axios({
    url: api.payInfo,
    method: 'get'
  })
}

/**
 * 查询权限信息
 */
export function OrgPermissionInfo() {
  return axios({
    url: api.orgPermissionInfo,
    method: 'get'
  })
}

/**
 * 合作资源配置保存
 */
export function TenantSave(data) {
  return axios({
    url: api.tenantSave,
    method: 'post',
    data
  })
}
/**
 * 修改支付配置
 */
export function UpdatePayInfo(data) {
  return axios({
    url: api.updatePayInfo,
    method: 'post',
    data
  })
}

/**
 * 查看会内资源
 */
export function InnerTenantInfo() {
  return axios({
    url: api.innerTenantInfo,
    method: 'get'
  })
}

/**
 * 保存会内资源
 */
export function InnerTenantSave(data) {
  return axios({
    url: api.innerTenantSave,
    method: 'post',
    data
  })
}

/**
 * @description 会内-根据项目类型查询资源配置
 * @date 24/11/2023
 * @export
 * @param {*} projectType 1 人脉 2 商城
 * @returns {*}
 */
export function getTenantInfoByProjectType(projectType) {
  return axios({
    url: api.getTenantInfoByProjectType + `/${projectType}`,
    method: 'get',
  })
}

/**
 * @description 会外-根据项目类型查询资源配置
 * @date 24/11/2023
 * @export
 * @param {*} projectType 1 人脉 2 商城
 * @returns {*}
 */
export function orgGetTenantInfoByProjectType(projectType) {
  return axios({
    url: api.orgGetTenantInfoByProjectType + `/${projectType}`,
    method: 'get',
  })
}

/**
 * @description 会内-根据项目类型修改设置
 * @date 24/11/2023
 * @export
 * @param {*} data
 */
export function tenantOneSave(data) {
  return axios({
    url: api.tenantOneSave,
    method: 'post',
    data
  })
}

/**
 * @description 会外-根据项目类型修改设置
 * @date 24/11/2023
 * @export
 * @param {*} data
 */
export function orgTenantOneSave(data) {
  return axios({
    url: api.orgTenantOneSave,
    method: 'post',
    data
  })
}
